package com.zc.im.mapper.im.group;

import com.zc.im.model.im.group.ZcImGroupMember;
import com.zc.im.model.im.group.ZcImGroupMemberExample;
import com.zc.im.model.im.group.ZcImGroupMemberKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcImGroupMemberMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int countByExample(ZcImGroupMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int deleteByExample(ZcImGroupMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_im_group_member",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcImGroupMemberKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_im_group_member (id, company_id, ",
        "user_id, group_id, ",
        "created_time, updated_time, ",
        "user_status, status)",
        "values (#{id,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, ",
        "#{userId,jdbcType=INTEGER}, #{groupId,jdbcType=INTEGER}, ",
        "#{createdTime,jdbcType=TIMESTAMP}, #{updatedTime,jdbcType=TIMESTAMP}, ",
        "#{userStatus,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcImGroupMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int insertSelective(ZcImGroupMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    List<ZcImGroupMember> selectByExample(ZcImGroupMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, company_id, user_id, group_id, created_time, updated_time, user_status, ",
        "status",
        "from zc_im_group_member",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcImGroupMember selectByPrimaryKey(ZcImGroupMemberKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcImGroupMember record, @Param("example") ZcImGroupMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcImGroupMember record, @Param("example") ZcImGroupMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcImGroupMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_member
     *
     * @mbggenerated
     */
    @Update({
        "update zc_im_group_member",
        "set company_id = #{companyId,jdbcType=INTEGER},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "group_id = #{groupId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "user_status = #{userStatus,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcImGroupMember record);
}